package com.lbd.project.bean;

import com.lbd.base.bean.AbstractEntity;
import lombok.*;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.Transient;
import java.util.Date;

/**
 * Created by Yuanbo on 2016/9/29.
 * 标的
 */
@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
@DynamicUpdate
@Entity
public class TargetInfo extends AbstractEntity {
    //构造函数
    public TargetInfo(String id, String loanNumber, String telephone, String bdrealname, String productid, String htje,
                      Integer htqx, String hkfs, String hkqs, Date lendingDay, String targetState) {
        this.id = id;
        this.loanNumber = loanNumber;
        this.telephone = telephone;
        this.bdrealname = bdrealname;
        this.productid = productid;
        this.htje = htje;
        this.htqx = htqx;
        this.hkfs = hkfs;
        this.hkqs = hkqs;
        this.lendingDay = lendingDay;
        this.targetState = targetState;
    }

    ;
    //1立即投资 2即将开放 3已满标 4还款中 5已完结 6流标
    public static final String TARGET_STATE_INVEST = "1"; //立即投资
    public static final String TARGET_STATE_OPEN = "2"; //即将开放
    public static final String TARGET_STATE_FULL = "3"; //已满标
    public static final String TARGET_STATE_PAYBACK = "4"; //还款中
    public static final String TARGET_STATE_ENDING = "5"; //已完结
    public static final String TARGET_STATE_BIDDERS = "6"; //流标
    //审核状态
    public static final String TARGET_AUDIT_WITING = "1"; //待审核
    public static final String TARGET_AUDIT_SUCESS = "2"; //审核通过
    public static final String TARGET_AUDIT_FAIL = "3"; //审核未通过
    //还款方式
    public static final String TARGET_BACK_FIRST = "1"; //一次性还款付息
    public static final String TARGET_BACK_SECOND = "2"; //按月付息到期还本
    public static final String TARGET_BACK_THIRD = "3"; //等额本息
    //前台新增 begin
    private Integer experienceTarget; //体验金标 1:是 0 否
    private String startAmount;//起投金额
    private String bonusType;//可使用奖励类型 1特权本金,2加息卷,3现金卷
    private Double addRate;//增加利率
    private Date endDate;//完结时间
    private Date fullDate;//满标时间
    private Date lendingDay;//放款日 即:每月还款日
    private String backTotal;//已还总额
    private String totlePerson;//投资总人数
    //前台新增 end
    //后台新增 begin
    private String loanNumber;//借款编号
    private String auditStatus;//审核状态
    private Date auditTime;//审核通过时间,发布时间
    private String suggestion;//审核意见
    private String targetState;//标的状态 1立即投资 2即将开放 3已满标 4还款中 5已完结 6流标
    private Date mjStart;//募集开始时间
    private Date mjEnd;//募集结束时间
    private String userId;//用户id
    private String telephone;//用户名(手机号)
    private String sortFirst;//置顶排序
    private String investAmount;//已投金额
    @Lob
    private String otherContent; //json串
    //后台新增 end
    //思维力达 begin
    private String consultid;//咨询编号,
    private String idcard;// 身份证号码
    private String bdrealname;//	真实姓名
    private String province;//项目所在省
    private String city;//项目所在市
    private String productid;//	借款类型id
    private String productname;//借款类型
    private String htje;//借款金额
    private Integer htqx;//借款期限
    private String nhsyl;//预计年化收益率
    private String hkfs;//还款方式 1一次性还本付息  2按月付息到期还本 3等额本息
    private String rzqx;//融资期限
    private String hkqs;//还款期数
    private String fwf;//平台收取费用
    private String borrowuse;//借款描述
    @Lob
    private String remark;//风控师意见
    //思维力达 end


    ///// 非持久化字段
    @Transient
    private String backAmount; //应还金额--还款中的项目
    @Transient
    private String remainderDays;//当期剩余天数--还款中的项目
    @Transient
    private String qsAll;//应还期数--还款中的项目
    @Transient
    private Date yhkr;//应还款日--还款中的项目
}
